home *** CD-ROM | disk | FTP | other *** search
- import java.applet.*;
- import java.awt.*;
-
- public class imageExample extends Applet {
- Image ims[];
- MediaTracker mt;
- boolean good;
-
- public void init() {
- good = true;
- mt = new MediaTracker(this);
- ims = new Image[10];
-
- /* The following loop loads images named im0.gif,
- im1.gif, etc. residing on the same server as the
- applet's document.*/
-
- for (int i = 0; i<= 9; i++) {
- ims[i] = getImage(getDocumentBase(),"img"+i+".gif");
- mt.addImage(ims[i],0); /* places the image in the
- MediaTracker with an id
- number of 0 */
- }
- try {
- mt.waitForID(0);
- }
- catch (InterruptedException e) {
- System.out.println("Error in loading images: " + e);
- }
- if (mt.isErrorID(0))
- good = false;
- }
- }
-
-